Plumbing Components

What are these called and what are their function? Are they the same thing?

What are these called and what are their function? Are they the same thing?